using UnityEngine;
using QFramework;

namespace ProjectSurvivor
{
	public partial class Hp : PowerUp
	{
        protected override Collider2D Collider2D => SelfCircleCollider2D;

        private void OnTriggerEnter2D(Collider2D collision)
        {
            if (collision.GetComponent<CollectableArea>())
            {
                if(Global.Hp.Value == Global.MaxHp.Value)
                {

                }
                else
                {
                    FlyingToPlayer = true;
                }
                
            }
        }
        protected override void Execute()
        {
            AudioKit.PlaySound("Hp");
            Global.Hp.Value++;
            this.DestroyGameObjGracefully();
        }
    }
}
